package com.github.cyf.requestLock.controller;

import com.github.cyf.common.module.Rs;
import com.github.cyf.requestLock.annotation.RequestLock;
import com.github.cyf.requestLock.entity.User;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenyifan
 * @create 2025-01-20 14:39
 */
@RestController
@RequestMapping("/repeatSubmit")
@Api(tags = "重复提交")
public class RepeatSubmitController {

    @ApiOperation(value = "提交表单")
    @ApiOperationSupport(order = 1)
    @PostMapping("/submit")
    @RequestLock(prefix = "userFormSubmit", expire = 300)
    public Rs login(@RequestBody User user) {
        return Rs.ok("提交成功");
    }
}
